Repository navigation
fix(scout-for-lol): open the narrow-width tooltip sheet from the keyboard - #5561
shepherdjerred wants to merge 1 commit into
Conversation
…oard Why Under 640px a tooltip opens as a bottom sheet, but only a click opened it. Page-rendered triggers (setup items, later-game items, recent-change labels) are spans and list items with a tabindex, which produce no click from Enter or Space, so a keyboard user below 640px could not open them (AI-1225, found in review of #5548). The desktop layer opens on focus and moves in on Enter, Space or ArrowRight. What - The sheet now has a key rule: Enter or Space on a trigger that does not click natively opens the sheet. Links, buttons and other natively activated triggers stay with their click so the sheet opens once. - The rule is shared by a rendered trigger (onKeyDown) and a page-rendered one (DOM listener), as the click rule already was. Opening moves focus into the sheet; Escape closes it and returns focus to the trigger. - A page-rendered link stays a popover on a phone, so focus shows its layer, ArrowRight enters it and Enter follows the link. - Unit tests for the key rule; Playwright e2e at 390px for the page-rendered trigger (Enter and Space), the link, and a rendered trigger. Verification - bunx turbo run build typecheck test lint --filter='...@scout-for-lol/design-system': green - bunx turbo run test:e2e --filter=@scout-for-lol/design-system: 1230 passed - the page-rendered e2e fails with the key rule disabled - bun run jscpd, check-directory-file-counts, lefthook pre-commit: pass - Not run: design-audit goldens (no rendered change), live deployment Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
|
This change is part of the following stack: Change managed by git-spice. |
|
Automatic reviews are disabled for this repository. Configure in Code Review Settings. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
@codex review Automated re-review request for |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Why
Under 640px a tooltip opens as a bottom sheet, but only a click opened it. Page-rendered triggers from #5548 (setup items, later-game items, recent-change labels) are spans and list items with a
tabindex, which produce no click from Enter or Space, so a keyboard user below 640px could not open them (AI-1225, found in the review of #5548). On desktop the same trigger opens its layer on focus and moves into it on Enter, Space or ArrowRight.What
rich-tooltip-sheet.tsx: the sheet gets a key rule next to its click rule. Enter or Space on a trigger that does not click natively opens the sheet. Links, buttons and other natively activated triggers stay with their click, so the sheet opens once. The same rules object feeds a rendered trigger (onKeyDown) and a page-rendered one (useTriggerListeners), as the click rule already did.rich-tooltip-external.ts:opensSheet(the pure key decision) andisNativelyActivated.onCloseAutoFocus).Deviation from the brief: the sheet has no timers (the hover controller is not involved), so the unit tests cover the pure key rule in
rich-tooltip-external.test.tsrather than using fake timers; the timing is untouched.Demo
Behaviour change with no visual change, so the evidence is the 390px keyboard e2e (
rich-tooltip.spec.ts,phonegroup). With the key rule disabled the page-rendered case fails; with it, it passes:Verification
bunx turbo run build typecheck test lint --filter='...@scout-for-lol/design-system': green (design-system 212 tests, frontend 129, scout-for-lol 115).bunx turbo run test:e2e --filter=@scout-for-lol/design-system: 1230 passed, including the three new 390px keyboard tests (page-rendered trigger with Enter and with Space, a page-rendered link, a renderedRichTooltiptrigger). Re-run after the rebase onorigin/main: the 13rich-tooltiptests pass.bun run jscpd(baseline ratchet passed),bun run check-directory-file-counts,bunx lefthook run pre-commit: pass.tier: "extended"steps.ci-playwrightbaselines stay valid; CI's design-audit run is the check.🤖 Generated with Claude Code
https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y